<style>
label {
	width:112px!important;
}
</style>
<?php $des= explode(",", $detail['destination']);?>
<div id="box">
  <form method="post" action="<?php echo base_url(); ?>admin/package/<?php if(isset($_GET['id'])) echo "update?id=".$_GET['id'];else echo "insert";?>" enctype="multipart/form-data">
    <fieldset id="personal">
      <legend>&nbsp;&nbsp;Edit package&nbsp;&nbsp;</legend>
      <label>ID : </label>
      <?php if(count($detail)>0) echo $detail['id'];else echo "ID"; ?>
      <br />
      <label>Title : </label>
      <input required name="title" id="title" type="text" value="<?php echo $detail['title']; ?>">
      <br />
      <label>Promotion : </label>
      <?php 
										$fck = new FCKeditor('promotion');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['promotion'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?>
      <br />
      <label>Banner Description : </label>
      <?php 
										$fck = new FCKeditor('description');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['description'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?>
      <br>
      <label>Number Day : </label>
      <input name="numberday" type="text" required value="<?php echo $detail['numberday'] ?>"/>
      <br>
      <label>Category : </label>
      <select name="category" style="margin-left:0;">
        <option value="0">Prefer type of activities</option>
        <option value="1" <?php if($detail['category']==1) echo "selected"; ?>>Special Offers</option>
        <option value="2" <?php if($detail['category']==2) echo "selected"; ?>>Cultural</option>
        <option value="3" <?php if($detail['category']==3) echo "selected"; ?>>Adventure & Active</option>
        <option value="4" <?php if($detail['category']==4) echo "selected"; ?>>Pilgrimage</option>
        <option value="5" <?php if($detail['category']==5) echo "selected"; ?>>Eco & Social</option>
      </select>
      <br>
      <div style="float:left;width:100%;">
        <label>Destination : </label>
        <div style="float:left;">
          <input type="hidden" value="" name="destination" id="destination"/>
          <input id="destination1" <?php for($i=0;$i<count($des);$i++){
		  								 	if($des[$i]=="Bagan"){
												echo "checked='checked'";
											}
										 }	?> style="float:left;margin-top:2px;" type="checkbox" value="Bagan"/>
          &nbsp;Bagan<br />
          <input id="destination2" <?php for($i=0;$i<count($des);$i++){
		  								 	if($des[$i]=="Inle"){
												echo "checked='checked'";
											}
										 }	?> style="float:left;margin-top:2px;" type="checkbox" value="Inle"/>
          &nbsp;Inle<br />
          <input id="destination3" <?php for($i=0;$i<count($des);$i++){
		  								 	if($des[$i]=="Mandalay"){
												echo "checked='checked'";
											}
										 }	?> style="float:left;margin-top:2px;" type="checkbox" value="Mandalay"/>
          &nbsp;Mandalay<br />
          <input id="destination4" <?php for($i=0;$i<count($des);$i++){
		  								 	if($des[$i]=="Yangon"){
												echo "checked='checked'";
											}
										 }	?> style="float:left;margin-top:2px;" type="checkbox" value="Yangon"/>
          &nbsp;Yangon</div>
      </div>
      <br>
      <label>Avatar : </label>
      <input style="float:left;" name="fuavatar" type="file" tabindex="2">
      <img src="<?php echo base_url().'uploads/package/'. $detail["avatar"];?>" width="97" height="75" style="margin-top:-45px;" /> <br>
      
      <label>Overview : </label>
      <?php 
										$fck = new FCKeditor('overview');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['overview'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?>
      <br>
      <label>Itinerary : </label>
      <?php 
										$fck = new FCKeditor('itinerary');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['itinerary'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?>
      <br />
      <label>Include : </label>
      <?php 
										$fck = new FCKeditor('include');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['include'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?>
      <br />
      <label>Exclude : </label>
      <?php 
										$fck = new FCKeditor('exclude');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['exclude'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?>
      <br />
      <label>Policy : </label>
      <?php 
										$fck = new FCKeditor('policy');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['policy'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?>
      <br />
      <label>Guest's review : </label>
      <?php 
										$fck = new FCKeditor('guestreview');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['guestreview'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?>
      <br />
      <label>Status : </label>
      <select name="status" style="margin-left:0">
        <option value="0">Choose Status</option>
        <option value="1" <?php if($detail['status']==1) echo "selected"; ?>>Highlights</option>
        <option value="2" <?php if($detail['status']==2) echo "selected"; ?>>Normal</option>
        <option value="3" <?php if($detail['status']==3) echo "selected"; ?>>Hide</option>
      </select>
      <br />
      <label>Length : </label>
      <input name="length" value="<?php echo $detail['length'] ?>"/>
      <br />
      <label>Recommendations : </label>
      <select name="recommendations" style="margin-left:0">
        <option value="0">Choose Our Recommendations</option>
        <?php for($i=1;$i<20;$i++){?>
        <option value="<?php echo $i ?>" <?php if($detail['recommendations']==$i) echo "selected";?>><?php echo $i ?></option>
        <?php }?>
      </select>
      <br />
      <div style="float:left;padding-top:5px;padding-left:40%;">
        <input type="reset" value="Reset">
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="submit" onclick="return checkform();" value="Submit">
      </div>
    </fieldset>
  </form>
</div>
<script>	
	var des=[];
	function checkform(){
		for(var i=1;i<=4;i++){
		  	 if($('#destination'+i).is(':checked')==true){
				des.push($('#destination'+i).val());
			 }else{
			}
		}
		$('#destination').val(des);
	}

</script>
